#include<t_stdio.h>
#include <sys/wait.h>
#include<unistd.h>
#include<stdlib.h>
#include <sys/types.h>
int main(void ){
	//创建子进程
	int pid;
	pid = fork();
	if(pid==-1)E_MSG("fork .. ",-1);
	if(pid==0){//子进程执行代码
	printf("child process.. %d\n",getpid());
	exit(0);
	}
	else {//父进程执行代码
	//父进程阻塞等待回收子进程的资源
	wait(NULL);
	printf("parent process..\n");
	}

	
	return 0;
}
